package com.teach.javafxclient.util;

import com.teach.javafxclient.Globalvar;
import com.teach.javafxclient.MainApplication;
import com.teach.javafxclient.controller.base.StudentSelectController;
import com.teach.javafxclient.request.HttpRequestUtil;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import kong.unirest.HttpResponse;
import kong.unirest.Unirest;

import java.io.IOException;

/**
 * @author Liang Jianlin
 * @date 2024-05-16 15:16
 */
public class DialogUtil {
    public static void show(double width,double height,String title,Parent root){
        Stage stage = new Stage();
        Scene scene = new Scene(root, width, height);
        stage.setTitle(title);
        stage.setScene(scene);
        stage.show();
        stage.setOnCloseRequest(event -> {
            HttpRequestUtil.close();
        });
    }
}
